home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 June: Reference Library / Dev.CD Jun 95 / Dev.CD Jun 95.toast / What's New? / New System Software Extensions / QuickDraw 3D ß / Programming / SampleCode / Modeller ƒ / Modeller_document.h < prev    next >
Encoding:
Text File  |  1995-03-06  |  3.9 KB  |  115 lines  |  [TEXT/MPS ]

  1. // Modeller_Document.h
  2. //
  3. // Document related data structures and function prototypes for the 
  4. // document type used in the modeller application
  5. //
  6. // Modification History
  7. //
  8. //    11/26/94        nick        initial cut - symantec proto_helper app, add defines
  9. //                                and strip stuff from the globals.h file
  10. //    01/24/95        nick        add field for backfacing style
  11.  
  12. #ifndef _MODELLER_DOCUMENT_H_
  13. #define _MODELLER_DOCUMENT_H_
  14.  
  15.  
  16. #include "Modeller_Offscreen.h"
  17.  
  18. //    Data Structures.
  19.  
  20. typedef struct WindowOffscreen {
  21.     CGrafPtr        windowPort;
  22.     GDHandle        windowDevice;
  23.     GWorldPtr        offscreenWorld;
  24. } WindowOffscreen;
  25.  
  26. //    Data Structures.
  27.  
  28. typedef struct _DocumentRecord {
  29.     WindowPtr                theWindow;
  30.     FSSpec                    theFileSpec ;
  31.     short                    fRefNum;
  32.     short                    dirty;
  33.     
  34. #ifdef PODIUM_APP
  35.     // the main difference between modeller and podium is that 
  36.     // podium has a background picture that is displayed behind
  37.     // the group, and that the group uses a pixmap draw context
  38.     // which is variable sized and "floats" above the background 
  39.     // picture.  To make this work, we need 2 extra GWorlds, one
  40.     // for the BG picture and one to attach to the pixmap draw 
  41.     // context
  42.     
  43.     GWorldPtr                bgOffscreen ;            // holds a pict the size of the main window.
  44.     GWorldPtr                screenBuffer ;            // use for compositing to reduce flicker
  45.                                                     // same size as the above.
  46.                                                     
  47.     GWorldPtr                geometriesOffscreen ;    // initially a 200x200 offscreen for the geo's.
  48.     GWorldPtr                maskOffscreen ;            // same size as geo's - 1 bit mask.
  49.  
  50.     Rect                    bgRect ;                //
  51.     Rect                    dropArea;
  52.     GWorldPtr                drawContextOffscreen;
  53.     Point                    mouseLocation;
  54.     TQ3Object                currentlySelectedObject;
  55.     TQ3Boolean                selected;
  56.  
  57. #endif
  58.  
  59.  
  60.     TQ3GroupObject            documentGroup;                                // main group for the document
  61.     TQ3ViewObject            theView;                                    // the documents view object
  62.     TQ3Boolean                animateLights, animateModel;                // set to true if we are animating either the lights or the model
  63.     TQ3Boolean                light;                                        // set to true if the three lights are on
  64.     TQ3Boolean                shaded;                                        // we provide flat, per vertext or per pixel
  65.     TQ3GroupObject            dynamicLights;                                // the lighting for the scene
  66.     TQ3GroupObject            light1, light2, light3;                        // these objects indicate where the lights are (i.e. they are not the lights, but
  67.                                                                         // they indicate the location of the lights
  68.     TQ3TransformObject        lightXform1, lightXform2, lightXform3;        // transforms for the lights (used to map to their current position)
  69.     TQ3Matrix4x4                modelRotation;                                // the transform for the model
  70.     TQ3InterpolationStyle    currentInterpolation;
  71.     
  72.     TQ3StyleObject            backfacingStyle ;                            // the style to use for backface removal
  73.     TQ3ShaderObject            illuminationShader ;
  74.  
  75.     TQ3Point3D                documentGroupCenter;
  76.  
  77.     float                    documentGroupScale;
  78.     
  79.     TQ3SharedObject            viewHints;                                    // ViewHints for this doc
  80.  
  81.     TQ3Vector3D                rotationDir;
  82. } DocumentRecord, *DocumentPtr, **DocumentHandle ;
  83.  
  84. /* Modeller_offscreen.c */
  85. TQ3Status DrawOffscreen(DocumentPtr theDocument);
  86. void DrawOnscreen(DocumentPtr theDocument);
  87.  
  88.  
  89. // Modeller_document.c 
  90. void         AdjustDocumentView(DocumentPtr theDocument);
  91. void         AdjustScrollBar(DocumentPtr theDocument);
  92. void         PositionDocumentParts(DocumentPtr theDocument);
  93.  
  94. DocumentPtr NewDocument( TQ3SharedObject viewHints, TQ3GroupObject group );
  95.  
  96. Boolean     CloseDocument(DocumentPtr theDocument);
  97. Boolean     CloseAllDocuments(void);
  98.  
  99. void         DoActivateDocument(DocumentPtr theDocument, short activate);
  100. DocumentPtr GetDocumentFromWindow(WindowPtr theWindow);
  101.  
  102. TQ3Status InitializeGroup(TQ3GroupObject group);
  103.  
  104.  
  105. TQ3Status             ModellerDocument_NewLights( DocumentPtr theDocument ) ;
  106. TQ3CameraObject         ModellerDocument_NewCamera(WindowPtr theWindow);
  107. TQ3DrawContextObject    ModellerDocument_NewDrawContext(WindowPtr theWindow);
  108. TQ3Status            ModellerDocument_UpdateView( DocumentPtr theDocument, TQ3SharedObject viewHints ) ;
  109.  
  110. #ifdef PODIUM_APP
  111. // these functions are needed only for podium
  112. TQ3DrawContextObject ModellerDocument_NewPixmapDrawContext(DocumentPtr theDocument) ;
  113. #endif
  114.  
  115. #endif